package com.jxnu.escms.config;

import com.jxnu.escms.utils.UpdateData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;

import java.time.LocalDateTime;

@Slf4j
@Configuration
@EnableScheduling
public class SpiderTask {

    @Autowired
    private UpdateData updateData;

    @Scheduled(cron = "0 0 5,10,12,15,17 * * ?")
    private void spiderRun(){
        log.info("定时爬取疫情数据");
        updateData.updateData();
    }
}
